package com.pinkpig.excel;


import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.handler.WriteHandler;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;

import java.util.List;

/**
 * @author vincenfeng
 */
public class TableExportHelper {

    public static WriteSheet newWriteSheet(int sheetNo, String sheetName, List<WriteHandler> writeHandlers){
        ExcelWriterSheetBuilder sheetBuilder = EasyExcel.writerSheet(sheetNo, sheetName);
        if(null != writeHandlers){
            for(int i=0; i< writeHandlers.size(); i++){
                sheetBuilder.registerWriteHandler(writeHandlers.get(i));
            }
        }
        return sheetBuilder.build();
    }

    public static WriteCellStyle newEmptyCellType(){
        WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
        return contentWriteCellStyle;
    }

}
